-
Notifications
You must be signed in to change notification settings - Fork 7.6k
drivers: video: imager: move the boilerplate in a library #88003
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Force-push:
|
Add a library for the Camera Common Interface, part of the MIPI CSI protocol standard defining methods to configure a camera device over I2C, such as which size for the register address/data. Signed-off-by: Josuah Demangeon <me@josuah.net>
Reduce the amount of code in the GC2145 driver by switching to the CCI helpers in video_common.c. The batch I2C write functions are not used to avoid increasing the size of the ROM, as struct video_reg is 8 bytes while the ad-hoc struct gc2145_reg is 2 bytes. Signed-off-by: Josuah Demangeon <me@josuah.net>
Replace the ad-hoc register emulation by the dedicated I2C emulator, making it usable with the same APIs as every other image sensors. Signed-off-by: Josuah Demangeon <me@josuah.net>
Use the newly introduced CCI library instead of local implementation of I2C read/write commands. Signed-off-by: Josuah Demangeon <me@josuah.net>
Fix bug introduced in 46a262f where the fie.index field was expected to be incremented by the driver, while it is the responsibility of the caller to increment it. Signed-off-by: Josuah Demangeon <me@josuah.net>
From Linux docs:
|
Imagers, also known as image sensors, have drivers that look very similar. Add common implementation that fits most image sensors, which can be bypassed wherever this does not make the implementation simpler. Signed-off-by: Josuah Demangeon <me@josuah.net>
Make the emulated imager use the shared implementation of all imagers, making shared implementation of the image sensor drivers be tested by CI. Signed-off-by: Josuah Demangeon <me@josuah.net>
force-push:
|
This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. |
I confirm, this is not going to be pursued: The CCI library removes the bulk of the boilerplate copy-pasted between sensors already. |
Split out of:
Dependencies:
Downstream:
Most image sensor drivers are the same. What changes from driver to driver is mostly the content of tables of registers.
This offers a default implementation that will cover everything except
init()
,set_stream()
andset/get_ctrl()
.The emulated image sensor is converted to use this implementation as an example, while also making this shared code tested on CI.